package frame.options.virtual.create;

import java.awt.Dimension;
import java.awt.Point;
import java.util.List;

import javax.swing.ImageIcon;

import model.components.networks.virtual.VirtualNetwork;

import com.nexes.wizard.Wizard;

import frame.SimulatorFrame;

public class CreateVirtualWizard extends Wizard
{	
	private SimulatorFrame simulatorFrame;
	public SimulatorFrame getFrame(){ return simulatorFrame; }
	public void setFrame( SimulatorFrame simulatorFrame ){ this.simulatorFrame = simulatorFrame; }
	
	private List< VirtualNetwork > virtualNetworks;
	public List< VirtualNetwork > getVirtualNetworks(){ return virtualNetworks; }
	public void setVirtualNetworks( List< VirtualNetwork > virtualNetworks ){ this.virtualNetworks = virtualNetworks; }
	
	public CreateVirtualWizard( SimulatorFrame simulatorFrame )
	{
		this.setFrame( simulatorFrame );
		
        this.getDialog().setTitle( "Create random virtual networks" );
        this.getDialog().setIconImage( ( new ImageIcon( this.getClass().getResource( "/icons/upcSmall.png" ) ) ).getImage() );
        this.registerWizardPanel( CreateVirtualSelectDescriptor.IDENTIFIER, new CreateVirtualSelectDescriptor() );
        this.registerWizardPanel( CreateVirtualFinishDescriptor.IDENTIFIER, new CreateVirtualFinishDescriptor() );
        this.setCurrentPanel( CreateVirtualSelectDescriptor.IDENTIFIER );
        
        Point topLeft = this.getFrame().getNetworksPanel().getLocationOnScreen();
		Dimension size = this.getFrame().getNetworksPanel().getSize();
		Dimension preferredSize = this.getDialog().getPreferredSize();
		this.getDialog().setLocation( topLeft.x + ( size.width / 2 ) - ( preferredSize.width / 2 ), topLeft.y + ( size.height / 2 ) - ( preferredSize.height / 2 ) );
	}
	
}
